import React, {Component} from 'react';
import './App.css';
import 'core-js';

import {Route, BrowserRouter as Router, Switch} from 'react-router-dom';
import Index from './views/Index';
import CustomerOperate from './views/customerOperate';
import Register from './views/register';
import SearchOrder from './views/searchOrder';
import SearchOrderDetail from './views/searchOrderDetail';
import AddOrder from './views/addOrder';
import ConfirmOrder from './views/comfirmOrder';
import DeliveryOrder from './views/deliveryOrder';
import DeliveryOrderList from './views/deliveryOrderList';
import FinishOrder from './views/finishOrder';
import DeliveryOrderDetail from './views/deliveryOrderDetail';
import FinishOrderDetail from './views/finishOrderDetail';
import Navigation from './views/navigation';
import Operation from './views/operation';
import CustomerBind from './views/customerBind';
import CustomerSearchAndBind from './views/customerSearchAndBind';
import CustomerOrder from './views/customerOrder';
import ConfirmMsg from './views/confirmMsg';
import {config} from './config';

const path = config.path;

class App extends Component {
    render() {
        return (
            <Router>
                <Switch>
                    <Route path={path + "/index"} component={Index}/>
                    <Route path={path + "/customerOperate"} component={CustomerOperate}/>
                    <Route path={path + "/operation"} component={Operation}/>
                    <Route path={path + "/register"} component={Register}/>
                    <Route path={path + "/searchOrder"} component={SearchOrder}/>
                    <Route path={path + "/searchOrderDetail"} component={SearchOrderDetail}/>
                    <Route path={path + "/addOrder"} component={AddOrder}/>
                    <Route path={path + "/confirmOrder"} component={ConfirmOrder}/>
                    <Route path={path + "/deliveryOrder"} component={DeliveryOrder}/>
                    <Route path={path + "/deliveryOrderList"} component={DeliveryOrderList}/>
                    <Route path={path + "/finishOrder"} component={FinishOrder}/>
                    <Route path={path + "/deliveryOrderDetail/:id"} component={DeliveryOrderDetail}/>
                    <Route path={path + "/finishOrderDetail/:id"} component={FinishOrderDetail}/>
                    <Route path={path + "/navigation/:type"} component={Navigation}/>
                    <Route path={path + "/customerBind"} component={CustomerBind}/>
                    <Route path={path + "/customerSearchAndBind"} component={CustomerSearchAndBind}/>
                    <Route path={path + "/customerOrder/:id"} component={CustomerOrder}/>
                    <Route path={path + "/confirmMsg"} component={ConfirmMsg}/>
                    <Route component={Index}/>
                </Switch>
            </Router>
        );
    }
}

export default App;
